#coding:utf8
SNR = range(-10,31)

a = [0.374, 0.391, 0.405, 0.426, 0.444,
 0.468, 0.488, 0.517, 0.537, 0.572,
 0.604, 0.642, 0.673, 0.715, 0.757,
 0.797, 0.842, 0.878, 0.912, 0.942,
 0.963, 0.980, 0.990, 0.995, 0.999,
 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1]

b = [0.19394566450837727, 0.20786329350510646, 0.21173486416127094, 0.2241172151391763, 0.23519791736199186, 0.2523196048327882, 0.2626994192644016, 0.27711768239770374, 0.301248247780522, 0.31590014017755824, 0.345137173753421, 0.3676323342901008, 0.39843802149389224, 0.42704091849676257, 0.4605500300380482, 0.5036379413924305, 0.5460917161738201, 0.5950537347306588, 0.6332354315466258, 0.6891062011881717, 0.7384687270542687, 0.7879981309658901, 0.8345904812762833, 0.876309992657366, 0.9149255723916961, 0.9346839329817769, 0.9568119618183032, 0.9702289566784594, 0.9789066150457246, 0.9885521660770309, 0.9876176490220947, 0.99876510246312, 0.9957279220345772, 0.9980308390628129, 0.9990321073359589, 0.998998731726854, 1.0, 1.0, 1.0, 1.0, 1]

c = [0.09875842734129898, 0.09909218343234764, 0.10893798811828316, 0.11244242707429411, 0.11971830985915492, 0.12856284627194448, 0.13650624123890262, 0.14268072892330286, 0.15619785061077365, 0.16550964555103131, 0.17582270876443495, 0.19451304986316, 0.20552700086776585, 0.2285561711501235, 0.24754689273079233, 0.2709431947133035, 0.2955410186235899, 0.3312529203657967, 0.3565850076763901, 0.3984046458847874, 0.4319805086442828, 0.4782057272545224, 0.5212936386089047, 0.5609772378345905, 0.6005940858420666, 0.6620052065950204, 0.7171417128362593, 0.7251184834123223, 0.7903010479941259, 0.7769508043521794, 0.8473399639543422, 0.8597556905413524, 0.8983378946665777, 0.8954675922835592, 0.9306121086709832, 0.936982177424738, 0.9458520793004472, 0.9549429277084307, 0.9525145183899606, 0.9679467325278687, 0.973]


import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['simhei'] #用来正常显示中文标签

plt.rcParams['axes.unicode_minus']=False #用来正常显示负号

a = [0.95*(1-x) for x in a]
b = [0.91*(1-x) for x in b]
c = [0.91*(1-x) for x in c]

line_lrs, = plt.plot(SNR,a, 'rv-', label='QPSK')
line_mlp, = plt.plot(SNR,b, 'go-', label='8PSK')
line_16psk, = plt.plot(SNR,c, 'bs-', label='16PSK')
plt.legend([line_lrs,line_mlp, line_16psk],['QPSK', '8PSK', '16PSK'])
plt.xlabel(u"信噪比(dB)", fontsize=16)
plt.ylabel(u"误符号率", fontsize=16)
plt.ylim(0,1)
#plt.show()

plt.savefig('CP4RNN.png')

